package appapi.entity.mqtt.mqttvo;

/**
 * @version: java version 1.8
 * @Author: Ygp Work
 * @description:
 * @date: 2023-07-08 9:21
 */
public enum TopicDataType {
    DATA("Data"),
    THRESHOLD("Threshold"),
    Reply("Reply"),
    ALARM("Alarm"),
    GSM("gsm"),
    REPLY("Reply"),
    Reginfo("reginfo"),
    READ("Read"),
    WORKSET("Workset"),
    MOMENT("Moment"),
    CALIBRATION("Calibration"),
    GENERIC("Generic"),
    CAMERA("Camera"),
    OBSTACLE("Obstacle"),
    VALUEAD("ValueAD"),
    STATUS("Status"),
    DEMAND("Demand"),
    CFGDEMAND("CfgDemand"),
    CFGWORKSET("CfgWorkset");
    private final String dataType;
    TopicDataType(String dataType) {
        this.dataType = dataType;
    }
    public String getDataType() {
        return dataType;
    }
    public static TopicDataType fromString(String dataType) {
        for (TopicDataType type : TopicDataType.values()) {
            if (type.getDataType().equalsIgnoreCase(dataType)) {
                return type;
            }
        }
        throw new IllegalArgumentException("No constant with text " + dataType + " found");
    }
}